using UnityEngine;

public class Magazine : MonoBehaviour
{
	public Rigidbody2D rb;

	public Collider2D col;

	public SpriteRenderer sr;

	public AudioSource audioSource;

	private bool onGround;

	private void OnCollisionEnter2D(Collision2D collision)
	{
		if (!onGround)
		{
			base.transform.SetParent(null);
			sr.sortingOrder = 0;
			audioSource.Play();
			Object.Destroy(rb, 0.5f);
			Object.Destroy(col, 0.5f);
			Object.Destroy(audioSource, 1f);
			Object.Destroy(this, 1.1f);
			onGround = true;
		}
	}
}
